package com.framework.modules.base.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.framework.common.utils.PageUtils;
import com.framework.common.utils.Query;
import com.framework.modules.base.dao.PostsTrashDao;
import com.framework.modules.base.entity.PostsTrashEntity;
import com.framework.modules.base.service.PostsTrashService;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("postsTrashService")
public class PostsTrashServiceImpl extends ServiceImpl<PostsTrashDao, PostsTrashEntity> implements PostsTrashService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<PostsTrashEntity> page = this.selectPage(
                new Query<PostsTrashEntity>(params).getPage(),
                new EntityWrapper<PostsTrashEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public Integer addPostsTrash(PostsTrashEntity postsTrashEntity) {
        return baseMapper.insert(postsTrashEntity);
    }


}
